package tt.dz.egobus.servicemanager.business.listener;

import org.springframework.context.ApplicationContext;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.redis.core.RedisTemplate;
import tt.dz.egobus.servicemanager.bean.RedisTopicMessage;

import java.util.Map;

/**
 * @author Anson
 * @date 17-9-7
 * @name 基于redis的事件发布和取消
 * @since 1.0.7
 */
public interface RedisEventPublish {


    /**
     * @param dataMap
     * @param redisTemplate
     * @param applicationContext
     * @param converter
     * @author Anson
     * @date 17-9-1
     * @name 处于业务消息发布
     * @since 1.0.7
     */
    void publish(Map<String, Object> dataMap, RedisTemplate redisTemplate,
                 ApplicationContext applicationContext, Converter<String, RedisTopicMessage> converter);

    /**
     * @param dataMap
     * @param redisTemplate
     * @param applicationContext
     * @param converter
     * @author Anson
     * @date 17-9-7
     * @name 处于业务消息发布取消
     * @since 1.0.7
     */
    void cancel(Map<String, Object> dataMap, RedisTemplate redisTemplate,
                       ApplicationContext applicationContext, Converter<String, RedisTopicMessage> converter);
}
